package com.example.bili.service.impl;

import com.example.bili.dao.LikeDao;
import com.example.bili.dao.LikeMapper;
import com.example.bili.entity.Like;
import com.example.bili.service.LikeService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LikeServicelmpl implements LikeService {
    @Resource
    private LikeMapper likeMapper;

    @Resource
    private LikeDao likeDao;
    @Override
    public boolean add(int userId, int trendId, int zhuangt) {
        return likeMapper.add(userId, trendId, zhuangt)>0;
    }



    @Override
    public List<Like> getLikeAll(int trendId) {
        return likeDao.getLikeAll(trendId);
    }

    @Override
    public boolean addLike(Like like) {
        return likeDao.addLike(like)>0;
    }

    @Override
    public boolean delLike(int id) {
        return likeDao.delLike(id)>0;
    }
}
